package com.ruijixiang.leetcode.everyday.leetcode2024.leetcode202409;

import java.util.PriorityQueue;

public class leetcode20240930 {
    /**
     * 座位预约管理系统
     */
    private final PriorityQueue<Integer> available=new PriorityQueue<>();

    public leetcode20240930(int n){
        for(int i=1;i<=n;i++){
            available.add(i);
        }
    }

    public int reserve(){
        return available.poll();
    }

    public void unreverse(int seatNumber){
        available.add(seatNumber);
    }
}
